Repository navigation
Conversation
aa148f2 to
9cfe1e8
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Change: Refactor Merge Risk:
|
af14521 to
db832f6
Compare
0b13cd6 to
33ebd87
Compare
33ebd87 to
39570b7
Compare
39570b7 to
dff6484
Compare
dff6484 to
3cccac2
Compare
3cccac2 to
ad493a9
Compare
ad493a9 to
ae7dd0e
Compare
68 enums become enum class. using enum keeps existing spellings such as IRT_EQ and IntVarBranch::SEL_RND compiling; class templates use static constexpr aliases instead, since using enum cannot name a dependent type. Enumerator values and order do not change. IntPropLevel is the only enum with operators and has an unsigned underlying type, because IntPropLevels stores levels in bit-fields. IPL_BITS_ is replaced by a private constant computed from the levels, and ev_t becomes EventType. Other conversions are now explicit, and installed headers need C++23. Zdev-Change-Id: Zbe6acb9cfd1f8806879c5c1a6bd306c2cf58f61134417b2e83c6ee379d2bce5f
Apply the approved constant renames with no compatibility aliases, following the IRT_LE to IRT_LT rename. RestartMode's RM_ constants become RESTART_, because ReifyMode shares that prefix, and truncated names such as SRT_DISJ and SOT_DUNION are spelled out. docs/code-style.md and the changelog list each rename. Enumerator values, printed strings, and option values do not change. Zdev-Change-Id: Z43bb475ac60ed9ff06a641cb09f52d90383860f01757f28f113e8f472c039503
ae7dd0e to
3f561f1
Compare
Unscoped enums leak their enumerators into the enclosing namespace and convert implicitly to
int, hiding type mismatches and accidental integer arithmetic. This PR converts the remaining unscoped enums across the public and test headers toenum classand replaces heavily abbreviated constant names with descriptive ones.Scoped enums
The remaining unscoped enums across Gecode's modules and test component become
enum class, keeping their underlying values and order unchanged. To keep migrations manageable,using enumat each enclosing scope preserves existing spellings such asIRT_EQ,Gecode::SS_FAILED, andIntVarBranch::SEL_RND; in class templates, whereusing enumcannot name a dependent type,static constexpraliases provide the same names.What stops compiling is implicit conversion to
int, arithmetic or bit shifts (such as1 << RM_EQV), array indexing, streaming, and comparing across different enums. Call sites now convert explicitly withstd::to_underlyingorstatic_cast. Because installed headers usestd::to_underlying, downstream projects need C++23 even if they do not consume Gecode through CMake.IntPropLevelis the one enum that supports bitwise operations. It gets anunsigned intunderlying type (matching the bit-fields inIntPropLevels), gainsoperator|,operator&, andoperator|=, and dropsIPL_BITS_in favor of an internal constant. Testing a bit now requires an explicit comparison such as(ipl & IPL_BASIC) != IPL_DEF.ev_tis also renamed toInt::Cumulatives::EventType.Descriptive constant names
Following the
IRT_LE->IRT_LTrename in #286, abbreviated enum constants are given descriptive names without compatibility aliases. Examples includeRestartMode(RM_*->RESTART_*, removing the prefix collision withReifyMode),ReifyMode::RM_PMI->RM_RIMP,TaskType(TT_FIXP/TT_FIXS/TT_FIXE->TT_FIXED_PROCESSING/TT_FIXED_START/TT_FIXED_END),SetRelType(SRT_DISJ/SRT_CMPL->SRT_DISJOINT/SRT_COMPLEMENT), andSetOpType(SOT_DUNION/SOT_INTER->SOT_DISJOINT_UNION/SOT_INTERSECTION). Underlying values, printed output, and CLI option strings do not change;docs/code-style.mdandchangelog.inlist every rename.Stack
Merge in this order. #242, #282, #283, #241, #284, and #285 are merged. #286 targets
main, and each later PR builds on the one before it so its diff shows only its own commits. The first four PRs are standalone search and random-number changes; #284 through #274 are the Gecode 7 changes split out of what used to be a single branch.Summary by CodeRabbit
IntPropLevelnow supports bitwise operators, has an unsigned underlying type, and no longer includesIPL_BITS_.